<% # @page_title="Insecure Protocols" %>
<% @mselect_insecprotos=1 %>
<% @table = @insecure_protocols %>
<% @action = "index" %>
<% @cont = "insecure_protocols" %>

<%= render :partial => 'layouts/page_count' %>

<table>
<thead>
  <tr>
    <th scope="col">
      <%= sort_link("Test Area", "session_test_area") %>
      <%= filterx_icon("Remove filter on #{session[:test_area]}", session[:test_area], :test_area, {:controller => 'test_areas', :action => 'set', :id => 'all'}) %>
    </th>

    <th scope="col"><%= sort_link("Host", "ip_address") %>
      <%= filterx_icon("Remove filter on host", @url_params[:host_id_v], :host_id_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Port", "port") %>
      <%= filterx_icon("Remove filter on port #{@url_params[:port_v]}", @url_params[:port_v], :port_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Trans Proto", "transport_protocol") %>
      <%= filterx_icon("Remove filter on #{@url_params[:trans_v]}", @url_params[:trans_v], :trans_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Nmap Service", "nmap_service_name") %>
      <%= filterx_icon("Remove filter on #{@url_params[:nmap_service_name_v]}", @url_params[:nmap_service_name_v], :nmap_service_name_v, {:controller => @cont}) %>
    </th>
  </tr>
</thead>

<tbody>
<%
odd_or_even = 0
for insecure_protocol in @insecure_protocols
    odd_or_even = 1 - odd_or_even
%>
  <tr class="odd<%=h odd_or_even %>">
    <td><%=h insecure_protocol.test_area_name %>
        <%= filter_icon("Show only #{insecure_protocol.test_area_name}", session[:test_area], {:controller => 'test_areas', :action => 'set', :id => insecure_protocol.test_area_id}) %>
     </td>

    <td><%= link_to_host(insecure_protocol.ip_address, {:controller => "hosts", :action => "showinsecprotos", :id => insecure_protocol.host_id}) %>
        <%= filter_icon("Show only #{insecure_protocol.ip_address}", @url_params[:host_id_v], {:controller => 'insecure_protocols', :host_id_v => insecure_protocol.host_id}) %>
    </td>

    <td><%=h insecure_protocol.port %>
        <%= filter_icon("Show only port #{insecure_protocol.port}", @url_params[:port_v], {:controller => 'insecure_protocols', :port_v => insecure_protocol.port}) %> </td>
    </td>

    <td><%=h insecure_protocol.transport_protocol %>
        <%= filter_icon("Show only #{insecure_protocol.transport_protocol} ports", @url_params[:trans_v], {:controller => 'insecure_protocols', :trans_v => insecure_protocol.transport_protocol}) %>
    </td>

    <td><%=h insecure_protocol.nmap_service_name %>
        <%= filter_icon("Show only #{insecure_protocol.nmap_service_name} ports", @url_params[:nmap_service_name_v], {:controller => 'insecure_protocols', :nmap_service_name_v => insecure_protocol.nmap_service_name}) %>
    </td>
  </tr>
<% end %>
</tbody>
</table>

<%= render :partial => 'layouts/page_count' %>
